<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org">
<head>
<title>Registration</title>
<link rel="stylesheet" type="text/css"
	th:href="@{/css/registration.css}" />
<link rel="stylesheet"
	href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script
	src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script
	src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
	<form th:action="@{/}" method="get">
		<button class="btn btn-md btn-warning btn-block" type="Submit">Go
			To Login Page</button>
	</form>

	<div class="container">
		<div class="row">
			<div class="col-md-6 col-md-offset-3">
				<form autocomplete="off" action="#" th:action="@{/registration}"
					th:object="${user}" method="post" class="form-horizontal"
					role="form">
					<h2>Registration</h2>
					<div class="form-group">
						<div class="col-sm-9">
							<label th:if="${#fields.hasErrors('name')}" th:errors="*{name}"
								class="validation-message"></label> <input type="text"
								th:field="*{name}" placeholder="Name" class="form-control" />
						</div>
					</div>

					<!--  <div class="form-group">
                    <div class="col-sm-9">
                        <label th:if="${#fields.hasErrors('lastName')}" th:errors="*{lastName}"
                               class="validation-message"></label>
                        <input type="text" th:field="*{lastName}"
                               placeholder="Last Name" class="form-control"/>
                    </div>
                </div>-->
					<div class="form-group">
						<div class="col-sm-9">
							<input type="text" th:field="*{email}" placeholder="Email"
								class="form-control" /> <label
								th:if="${#fields.hasErrors('email')}" th:errors="*{email}"
								class="validation-message"></label>
						</div>
					</div>

					<div class="form-group">
						<div class="col-sm-9">
							<input type="password" th:field="*{password}"
								placeholder="Password" class="form-control" /> <label
								th:if="${#fields.hasErrors('password')}" th:errors="*{password}"
								class="validation-message"></label>
						</div>
					</div>

					<div class="form-group">
						<div class="col-sm-9">
							<!--  input type="text" th:field="*{userType}" placeholder="userType"
								class="form-control" /> <label
								th:if="${#fields.hasErrors('userType')}" th:errors="*{userType}"
								class="validation-message"></label>-->
							<select class="form-control" th:field="*{userType}"
								id="user-type" name="brandclass" size="1">
								<option value="user" selected>user</option>
								<option value="admin">admin</option>
							</select>
						</div>
					</div>



					<div class="form-group">
						<div class="col-sm-9">
							<button type="submit" class="btn btn-primary btn-block">Register</button>
						</div>
					</div>

					<h2>
						<span class="text-success" th:utext="${successMessage}"></span>
					</h2>

				</form>
			</div>
		</div>
	</div>

</body>
</html>